﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThanhTu.GNC.Media.KQXS.DataAccess.DAL;
using ThanhTu.GNC.Media.KQXS.DataAccess.DO;
using System.Data;

namespace ThanhTu.GNC.Media.KQXS.DataAccess.BL
{
   public class GroupNewsBL : IDisposable
    {
        private GroupNewsDAL vGroupNewsDAL = null;
        private bool disposed = false;
        public GroupNewsBL()
        {
            if (vGroupNewsDAL == null)
            {
                vGroupNewsDAL = new GroupNewsDAL();
            }
        }
        ~GroupNewsBL() { Dispose(false); }

        #region IDisposable Members

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (vGroupNewsDAL != null)
                    {
                        vGroupNewsDAL.Dispose();
                        vGroupNewsDAL = null;
                    }
                }

                disposed = true;
            }
        }

        #endregion

        public int SaveGroupNews(GroupNewsDO vGroupNewsDO) { return vGroupNewsDAL.SaveGroupNews(vGroupNewsDO); }
        public int UpdateGroupNews(GroupNewsDO vGroupNewsDO) { return vGroupNewsDAL.UpdateGroupNews(vGroupNewsDO); }
        public int DeleteGroupNews(int groupID) { return vGroupNewsDAL.DeleteGroupNews(groupID); }
        public GroupNewsDO getbyGroupNews(int GroupID) { return vGroupNewsDAL.getbyGroupNews(GroupID); }
        public DataTable selectAll_Page(int pageIndex, int pageSize, ref int rowCount) { return vGroupNewsDAL.selectAll_Page(pageIndex,  pageSize, ref  rowCount); }
    }
}
